//
//  Clear.swift
//  tabSwitch
//
//  Created by Apple on 2021/6/11.
//

import SwiftUI

struct Clear: View {
    @EnvironmentObject var modelData : TabItemsModelData
    var width: CGFloat = UIScreen.main.bounds.width
    var callback: TabSwitchCallBack?
    var body: some View {
        Button(action:{
            callback?.deleteAllTabViews()
        }){
            Image("clear1")
                .resizable()
                .background(Color.white)
                .frame(width: width/10, height: width/10, alignment: /*@START_MENU_TOKEN@*/.center/*@END_MENU_TOKEN@*/)
                
                .clipShape(Circle())
                //.overlay(Circle().stroke(Color.white, lineWidth: 2))
                
                .shadow(color: .gray, radius: 3, x: 0, y: 0)
        }
    }
}

struct Clear_Previews: PreviewProvider {
    static var previews: some View {
        Clear().environmentObject(TabItemsModelData())
    }
}
